package com.zy.cat.entity.game;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Index;
import javax.persistence.Table;

import com.zy.cat.entity.primary.CatDevGameCVSDrawCountHistoryPrimary;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @info 9趣猫神奇便利店中奖历史实体类
 * @author Link
 * @date 2019-10-30 09:14
 */
@Entity
@Table(name = "zy_cat_game_cvs_draw_history", indexes = {
		@Index(name = "pid", columnList = "pid"),
		@Index(name = "fid", columnList = "fid"),
		@Index(name = "dtype", columnList = "dtype"),
		@Index(name = "ztype", columnList = "ztype"),
		@Index(name = "stype", columnList = "stype"),
		@Index(name = "dstatus", columnList = "dstatus"),
		@Index(name = "estatus", columnList = "estatus"),
		@Index(name = "stime", columnList = "stime"),
		@Index(name = "etime", columnList = "etime"),
		@Index(name = "ltime", columnList = "ltime"),
		@Index(name = "ctime", columnList = "ctime") })
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("9趣猫神奇便利店中奖历史实体类")
@IdClass(CatDevGameCVSDrawCountHistoryPrimary.class)
public class CVSDrawHistory {
	
	@Id
	@Column(columnDefinition = "VARCHAR(30) NOT NULL  COMMENT '创建时间[9趣猫神奇便利店中奖历史实体类]'")
	@ApiModelProperty(value = "创建时间", example = "2019-02-22 12:56:56:666")
	private String ctime;
	
	@Column(columnDefinition = "CHAR(32) NOT NULL  COMMENT '中奖翻倍ID'")
	@ApiModelProperty(value = "中奖翻倍ID", example = "c9adb120ca2b48f88626ebd35000fa08")
	private String fid=UUID.randomUUID().toString().replace("-", "");
	
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '奖励翻倍（0.未翻倍、1.已经翻倍）'")
	@ApiModelProperty(value = "奖励翻倍（0.未翻倍、1.已经翻倍）", example = "0")
	private int ftype;
	
	@Column(columnDefinition = "VARCHAR(20) NOT NULL COMMENT '用户账号ID[9趣猫神奇便利店中奖历史实体类]'")
	@ApiModelProperty(value = "用户账号ID", example = "fe53d6a4fa29641")
	private String pid;

	@Column(columnDefinition = "VARCHAR(10) DEFAULT '-'  COMMENT '周期开始时间'")
	@ApiModelProperty(value = "周期开始时间", example = "2019-02-22")
	private String stime;
	
	@Column(columnDefinition = "VARCHAR(10) DEFAULT '-'  COMMENT '周期结束时间'")
	@ApiModelProperty(value = "周期结束时间", example = "2019-02-28")
	private String etime;
	
	@Column(columnDefinition = "INT(2) DEFAULT '-1' COMMENT '抽奖类型（-1.其他、0.抽奖、2.每日礼包、3.额外奖励）'")
	@ApiModelProperty(value = "抽奖类型（-1.其他、0.抽奖、2.每日礼包、3.额外奖励）", example = "0")
	private int dtype=-1;
	
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '额外奖励对应的抽奖次数'")
	@ApiModelProperty(value = "额外奖励对应的抽奖次数", example = "7")
	private int eindex;
	
	@Column(columnDefinition = "INT(2) DEFAULT '0' COMMENT '额外奖励领取状态，（0.未领取、1.已领取）'")
	@ApiModelProperty(value = "额外奖励领取状态，（0.未领取、1.已领取）", example = "0")
	private int estatus;
	
	@Column(columnDefinition = "INT(2) DEFAULT '-1' COMMENT '中奖类型（-1.其他、0.现金豆、1.商品碎片、2.广告红包、3.肥料数）'")
	@ApiModelProperty(value = "中奖类型（-1.其他、0.现金豆、1.商品碎片、2.广告红包、3.肥料数）", example = "0")
	private int ztype=-1;
	
	@Column(columnDefinition = "INT(2) DEFAULT '-1' COMMENT '商品碎片类型（-1.其他、0.小米扫地机器人、1.iPhone 11、2.小米平衡车、3.优酷会员卡、4.九阳榨汁机、5.9999现金豆红包）'")
	@ApiModelProperty(value = "商品碎片类型（-1.其他、0.小米扫地机器人、1.iPhone 11、2.小米平衡车、3.优酷会员卡、4.九阳榨汁机、5.9999现金豆红包）", example = "1")
	private int stype=-1;
	
	@Column(columnDefinition = "BIGINT(10) DEFAULT '0' COMMENT '中奖数(现金豆/碎片数/肥料数)'")
	@ApiModelProperty(value = "中奖数(现金豆/碎片数)", example = "100")
	private long dcount;
	
	@Column(columnDefinition = "INT(2) DEFAULT '1' COMMENT '中奖状态，（-1：不结算、0.结算中、1.已结算）'")
	@ApiModelProperty(value = "中奖状态，（-1：不结算、0.结算中、1.已结算）", example = "1")
	private int dstatus;
	
	@Column(columnDefinition = "VARCHAR(20) DEFAULT '-'  COMMENT '最后有效时间'")
	@ApiModelProperty(value = "最后有效时间", example = "2019-02-22 10:10:10")
	private String ltime;
	
	@Column(columnDefinition = "VARCHAR(200) DEFAULT '-' COMMENT '备注'")
	@ApiModelProperty(value = "备注", example = "备注")
	private String info = "-";
	

	public CVSDrawHistory(String pid) {
		super();
		this.pid = pid;
	}
	
	public CVSDrawHistory(String pid,int estatus) {
		super();
		this.pid = pid;
		this.estatus = estatus;
	}

	public CVSDrawHistory(String ctime, String pid, int dstatus, String ltime, int dtype) {
		super();
		this.ctime = ctime;
		this.pid = pid;
		this.dstatus = dstatus;
		this.ltime = ltime;
		this.dtype = dtype;
	}

	public CVSDrawHistory(String pid, int dstatus, String info) {
		super();
		this.pid = pid;
		this.dstatus = dstatus;
		this.info = info;
	}
	
}
